package com.ygp.core;


public class CMod {
    public static void main(String[] args) {
        bit();
        mod();
    }
    public static void bit() {
        int num = 10000 * 1000;

        int a = 1;
        long start = System.currentTimeMillis();
        for (int i = 1; i < num; i++) {
            a &= i;
        }
        long end = System.currentTimeMillis();
        System.out.println("bit耗时：" + (end - start));
    }
    public static void mod() {
        int num = 10000 * 1000;
        int a = 1;
        long start = System.currentTimeMillis();
        for (int i = 1; i < num; i++) {
            a %= i;
        }
        long end = System.currentTimeMillis();
        System.out.println("mod耗时：" + (end - start));
    }
}
